package com.api.user.controller;
import com.api.core.controller.Ctrl;
import com.api.core.response.Result;
import com.api.core.response.ResultGenerator;
import com.api.user.model.PaymentOrder;
import com.api.user.service.PaymentOrderService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Condition;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.List;
import com.api.core.annotation.PowerEnable;
import io.swagger.annotations.*;



/**
* Created by wanghuiwen on 2021/10/04.
*/
@PowerEnable(name = "payment_order",url = "/payment/order")
@Api(value = "payment_order", tags = {"payment_order"})
@RestController
@RequestMapping("/payment/order")
public class PaymentOrderController extends Ctrl{
    @Resource
    private PaymentOrderService paymentOrderService;
    @ApiOperation(value = "支付订单查询", tags = {"payment_order"}, notes = "支付订单查询")
    @PostMapping(value = "/list", name = "支付订单查询")
    public Result list(@RequestParam(defaultValue = "0") Integer page,
                       @RequestParam(defaultValue = "10") Integer size,
                       @RequestParam Integer orderType,
                       Authentication authentication) {
        return paymentOrderService.list(orderType, getAuthUser(authentication).getId(), page, size);
    }
}
